package com.zzu.base.controller.auth.vo;

import com.zzu.base.common.enums.SexEnum;
import jakarta.validation.constraints.*;
import lombok.Data;

@Data
public class RegisterReqVO {
    @NotBlank(message = "用户名不能为空")
    @Size(min = 1, max = 20, message = "用户名长度为1-20个字符")
    @Pattern(regexp = "^[\\u4e00-\\u9fa5a-zA-Z0-9]+$", message = "用户名只能包含中文、字母、数字和下划线")
    private String userName;

    @NotBlank(message = "昵称不能为空")
    @Size(min = 1, max = 20, message = "昵称长度为1-20个字符")
    @Pattern(regexp = "^[\\u4e00-\\u9fa5a-zA-Z0-9]+$", message = "昵称只能包含中文、字母、数字和下划线")
    private String nickName;

    @NotBlank(message = "密码不能为空")
    @Size(min = 12,max = 20,message = "密码长度为12-20个字符")
    @Pattern(
            regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&])[A-Za-z\\d@$!%*?&]*$",
            message = "密码必须包含大小写字母、数字和特殊符号（@$!%*?&），且不能包含其他字符"
    )
    private String password;

    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    private String email;

    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String phoneNumber;

    @NotNull(message = "性别不能为空")
    private SexEnum sex;

    // getter/setter 方法
}